package grape.attend.service.user.api;

import grape.attend.service.user.po.UserLeave;
import grape.common.service.common.IBaseService;

import java.util.List;

/**
 * <p>
 * 用户请假表 服务类
 * </p>
 *
 * @author yangwei
 * @since 2020-05-18
 */
public interface IUserLeaveService extends IBaseService<UserLeave> {

    /**
     * 根据假期申请单删除假期明细
     * @param userLeaveApplicationId
     * @return
     */
    default boolean removeByUserLeaveApplicationId(String userLeaveApplicationId){
        assertParamNotEmpty(userLeaveApplicationId,"userLeaveApplicationId不能为空");
        UserLeave userLeave = new UserLeave();
        userLeave.setUserLeaveApplicationId(userLeaveApplicationId);
        return remove(userLeave);
    }

    /**
     * 根据假期申请单查询假期明细
     * @param userLeaveApplicationId
     * @return
     */
    default List<UserLeave> getByUserLeaveApplicationId(String userLeaveApplicationId){
        assertParamNotEmpty(userLeaveApplicationId,"userLeaveApplicationId不能为空");
        UserLeave userLeave = new UserLeave();
        userLeave.setUserLeaveApplicationId(userLeaveApplicationId);
        return list(userLeave);
    }
}
